<template>
  <div>
    <!-- 面包屑 -->
    <el-bread></el-bread>
    <!-- 添加按钮 -->
    <el-button @click="addDialog" class="addBtn" type="primary" plain size="small">添加</el-button>
    <!-- 数据列表 -->
    <v-list @edit="edit"></v-list>
    <!-- 弹框 -->
    <v-dialog ref="diaRef" :isShow="isShow" :isAdd="isAdd" @cancel="cancel"></v-dialog>
  </div>
</template>
  
<script>
//引入封装好的弹窗，列表组件
import vDialog from '../meuu/dialog.vue';
import vList from '../meuu/list.vue'
export default {
  data() {
    return {
      isShow: false,
      isAdd: true
    };

  },
  components: {
    vList,
    vDialog
  },
  methods: {
    addDialog() {
      // 打开弹框
      this.isShow = true
      this.isAdd = true
    },
    cancel(e) {
      // 关闭弹框
      this.isShow = false
      console.log(222);
    },
    edit(id) {
      this.isShow = true
      this.isAdd = false
      this.$refs.diaRef.lookup(id)
    }
  }
};
</script>
  
<style scoped>
.addBtn {
  margin: 10px;
}
</style>
  